package org.act.BPEL2Automata.graphics.model;

import org.act.BPEL2Automata.automata.module.Message;

/**
 * This class used to act as a object to draw line with an arrow 
 * from one node to another.
 * 
 * @author baoxiwu<bb@feijiao.info>,ACT,Beihang University
 * @version 0.9.0
 * @since 2010-05-16
 * 
 */
public class TransitionRule{
	private State4G start = null;
	private Message message = null;
	private State4G end = null;
	
	
	public TransitionRule(){
	//empty
	}
	
	//TODO 4TESTING.
	public TransitionRule(State4G start,State4G end){
		this.start = start;
		this.end = end;
	}
	
	public TransitionRule(State4G start,Message message,State4G end){
		this.start = start;
		this.message = message;
		this.end = end;
	}
	
	//setter and getter methods
	public Message getMessage() {
		return this.message;
	}

	public void setMessage(Message message) {
		this.message = message;
	}

	public void setStartState(State4G start){
		this.start = start;
	}
	
	public State4G getStartState(){
		return this.start;
	}
	
	public void setEndState(State4G end){
		this.end = end;
	}
	
	public State4G getEndState(){
		return this.end;
	}
	
	public String toString(){
		return ("s" + this.getStartState().getID() + "_mes" + this.getMessage().getID() + "->s" + this.getEndState().getID());
	}
}
